var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (!cm.haveItem(4033893)) {
        cm.sendNormalTalk("没有水桶的话，无法盛水。", 16, 0, false, true);
        cm.dispose();
        return
    }
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.sendNormalTalk("罐子帽中已经盛满了水。快拿给修嘉吧。", 16, 0, false, true)
        } else {
            if (status === a++) {
                cm.gainItem(4033893, -1);
                if (cm.isQuestActive(32318)) {
                    cm.gainItem(4033896, 1)
                } else {
                    cm.gainItem(4033894, 1)
                }
                cm.dispose()
            }
        }
    }
};